package com.zhoufeng.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.core.ActionInvocation;

public class SessionInteceptor implements Interceptor {

	@Override
	public void intercept(ActionInvocation ai) {
		if (ai.getController().getSessionAttr("userinfo") == null) {
			ai.getController().render("/login.html");
		} else {
			ai.invoke();
		}
	}

}
